cmake_minimum_required(VERSION 3.18)

project ( APT_SLEUTH )

find_package(PkgConfig REQUIRED)
find_package(igraph REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_search_module(IGRAPH REQUIRED igraph)
pkg_search_module(LIBCJSON REQUIRED libcjson)

set (LIB_INCLUDE_DIRS
${LIBCJSON_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${IGRAPH_INCLUDE_DIRS}
)

set (LIB_LINK
    ${LIBCJSON_LIBRARIES}
    ${GLIB_LIBRARIES}
    )

include_directories(
    include
    ${LIB_INCLUDE_DIRS}
)

set (APT_SLEUTH_SRC 
    main.c
    event.c
    parser/parser.c
    parser/optc_parser.c
    processor/processor.c
    processor/optc_processor.c
    generater/generater.c
)

#set(CMAKE_EXE_LINKER_FLAGS "-static")

add_executable(apt_sleuth ${APT_SLEUTH_SRC})
target_link_libraries(apt_sleuth igraph::igraph)
target_link_libraries(apt_sleuth ${LIB_LINK})